namespace SumerCoreDevOps.Shared.Models.Messages;

/// <summary>
/// 节点注册消息
/// </summary>
public class NodeRegisterMessage
{
    /// <summary>
    /// 建立连接令牌（首次注册时必填）
    /// Join Token - 用于首次建立连接的一次性令牌
    /// </summary>
    public string? JoinToken { get; set; }

    /// <summary>
    /// 节点唯一标识（由执行节点生成）
    /// </summary>
    public string NodeKey { get; set; } = null!;

    /// <summary>
    /// 节点名称
    /// </summary>
    public string NodeName { get; set; } = null!;

    /// <summary>
    /// 支持的构建环境
    /// </summary>
    public List<string> SupportedEnvironments { get; set; } = [];

    /// <summary>
    /// 硬件信息
    /// </summary>
    public NodeHardwareInfo HardwareInfo { get; set; } = null!;
}

/// <summary>
/// 节点硬件信息
/// </summary>
public class NodeHardwareInfo
{
    /// <summary>
    /// CPU 核心数
    /// </summary>
    public int CpuCores { get; set; }

    /// <summary>
    /// 总内存（MB）
    /// </summary>
    public long TotalMemoryMB { get; set; }

    /// <summary>
    /// 操作系统
    /// </summary>
    public string OperatingSystem { get; set; } = null!;

    /// <summary>
    /// 架构（x64, arm64等）
    /// </summary>
    public string Architecture { get; set; } = null!;
}
